<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/default.xhtml"
	xmlns:p="http://primefaces.org/ui">
	<ui:define name="content">
		<p:panel header="Área de Trabalho">  
		 <h:form>
				<p:menubar>  
					<p:menuitem action="#{areaTrabalhoBean.pesquisarDocumentos()}" value="Pesquisar Documentos" update="tblDocumentos"/>
			        <p:menuitem value="Tramitar" onclick="openModal('http://localhost:8180/processo-web/index.jsf?codigoDocumento=1', 800, 600); return false;"/> 
				</p:menubar> 
				
				<p:spacer height="15"/>
				<p:fieldset legend="Resultado da Pesquisa" id="fsResultado">  
			  			<p:dataTable var="d" value="#{areaTrabalhoBean.documentos}" id="tblDocumentos">  
						       <p:column>  
						            <f:facet name="header">  
						                    N Protocolo  
						            </f:facet>  
						            <h:outputText value="#{d.numeroProtocolo}" />  
						        </p:column>  
						        <p:column>  
						            <f:facet name="header">  
						                    Assunto  
						            </f:facet>  
						            <h:outputText value="#{d.assunto}" />  
						        </p:column>  
						         <p:column>  
						            <f:facet name="header">  
						                    Assunto  
						            </f:facet>  
						            <h:outputText value="#{d.origemTramite}" />  
						        </p:column> 
						         <p:column>  
						            <f:facet name="header">  
						                    Data Emissão  
						            </f:facet>  
						            <h:outputText value="#{d.dataEmissao}">
						            	<f:convertDateTime pattern="dd/MM/yyyy"/>
						            </h:outputText>  
						        </p:column> 
						    </p:dataTable>  
					</p:fieldset> 
		</h:form>
	    </p:panel>
	</ui:define>
</ui:composition>
